package com.zto.design.observer;

import com.zto.design.observer.simple.Event;
import com.zto.design.observer.simple.OnBlur;
import com.zto.design.observer.simple.OnClick;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: sch-diy-parent
 * @description:观察者模式测试类--这种模式用于事件驱动机制
 * @author: sch
 * @create: 2020-11-27 14:27
 **/
public class ObserverTest {
    @Test
    public void testSimple() {
        Event event = new Event();
        event.registerEvent(new OnClick());
        event.registerEvent(new OnBlur());
        event.emit();
    }
}
